package com.xunai.saas.example.controller;

import com.xunai.saas.example.model.param.TongueAnalysisParam;
import com.xunai.saas.example.service.TongueService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 舌诊示例接口
 * @author Admin
 */
@RequestMapping("/tongueApi")
@RestController
public class TongueApiExample {

    @Resource
    TongueService tongueService;

    /***
     * 舌诊请求
     * @param tongueAnalysisParam
     * @return
     */
    @PostMapping("/tongueAnalysis")
    public String tongueAnalysis(@RequestBody TongueAnalysisParam tongueAnalysisParam) {
        return tongueService.tongueAnalysis(tongueAnalysisParam);
    }

    /***
     * 通过notifyCode,获取舌诊结果
     * @param notifyCode
     * @return
     */
    @GetMapping("/queryResult")
    public String queryResult(@RequestParam("notifyCode") String notifyCode) {
        return tongueService.queryResult(notifyCode);
    }
}
